package org.invigorare.auctions.comm;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;

public class Connectivity {


	public static boolean hasConnection(Context context) {
		ConnectivityManager conMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);  
		NetworkInfo info = conMgr.getActiveNetworkInfo();

		if(info != null && info.isConnected()) {  
			Log.v("conMgr","Connected State");  
		} else {
			Log.v("conMgr"," No Connection");
		}
		
		boolean connected = 
			(   info != null &&
	            info.isAvailable() &&
	            info.isConnected()   );
		
		return connected;
	}
	
}
